package com.lovo.web.controller;

import com.lovo.web.bean.ProductInfoBean;
import com.lovo.web.service.IProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("productInfo")
public class ProductInfoController {
    @Autowired
    public IProductInfoService productInfoService;
    @GetMapping("findByName/{productName}")
    public List<ProductInfoBean> findByName(@PathVariable("productName") String productName){
        return productInfoService.findByName(productName);
    }
    @GetMapping("findByNameAndSpecs")
    public ProductInfoBean findByNameAndSpecs(String Name, String Specs){
        return productInfoService.findByNameAndSpecs(Name, Specs);
    }

}
